package com.gather.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.api.service.ManageService;
import com.common.system.SystemData;
import com.common.utils.JsonUtil;

@Component
public class HeartThread extends Thread {
	
	@Autowired
	ManageService manageService;
	
	private boolean flag = true;//信号量
	
	private long sleppTime=1*1000L;
	
	@Override
	public void run() {
		while (flag) {
			try {
				Thread.sleep(sleppTime);
				String webConfigJson = JsonUtil.toJSONString(SystemData.webConfig);
				int strut = manageService.registerNode(webConfigJson);
			} catch (Exception e1) {
				e1.printStackTrace();
			}
		}
	}
}
